.class public Lcom/brixd/niceapp/community/adapter/AppListAdapter;
.super Landroid/widget/BaseAdapter;
.source "AppListAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/brixd/niceapp/community/adapter/AppListAdapter$ViewHolder;
    }
.end annotation


# instance fields
.field private mContext:Landroid/content/Context;

.field private mInstalledApps:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/community/model/InstalledAppModel;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/List;)V
    .registers 3
    .param p1, "context"    # Landroid/content/Context;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/community/model/InstalledAppModel;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 20
    .local p2, "installedApps":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/community/model/InstalledAppModel;>;"
    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 21
    iput-object p1, p0, Lcom/brixd/niceapp/community/adapter/AppListAdapter;->mContext:Landroid/content/Context;

    .line 22
    iput-object p2, p0, Lcom/brixd/niceapp/community/adapter/AppListAdapter;->mInstalledApps:Ljava/util/List;

    .line 23
    return-void
.end method


# virtual methods
.method public getCount()I
    .registers 2

    .prologue
    .line 27
    iget-object v0, p0, Lcom/brixd/niceapp/community/adapter/AppListAdapter;->mInstalledApps:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .registers 3
    .param p1, "position"    # I

    .prologue
    .line 32
    iget-object v0, p0, Lcom/brixd/niceapp/community/adapter/AppListAdapter;->mInstalledApps:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .registers 4
    .param p1, "position"    # I

    .prologue
    .line 37
    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .registers 9
    .param p1, "position"    # I
    .param p2, "convertView"    # Landroid/view/View;
    .param p3, "parent"    # Landroid/view/ViewGroup;

    .prologue
    .line 44
    if-nez p2, :cond_45

    .line 45
    iget-object v2, p0, Lcom/brixd/niceapp/community/adapter/AppListAdapter;->mContext:Landroid/content/Context;

    const v3, 0x7f030026

    const/4 v4, 0x0

    invoke-static {v2, v3, v4}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    .line 46
    new-instance v1, Lcom/brixd/niceapp/community/adapter/AppListAdapter$ViewHolder;

    invoke-direct {v1, p0}, Lcom/brixd/niceapp/community/adapter/AppListAdapter$ViewHolder;-><init>(Lcom/brixd/niceapp/community/adapter/AppListAdapter;)V

    .line 47
    .local v1, "holder":Lcom/brixd/niceapp/community/adapter/AppListAdapter$ViewHolder;
    const v2, 0x7f0a003a

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, v1, Lcom/brixd/niceapp/community/adapter/AppListAdapter$ViewHolder;->appName:Landroid/widget/TextView;

    .line 48
    const v2, 0x7f0a002f

    invoke-virtual {p2, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    iput-object v2, v1, Lcom/brixd/niceapp/community/adapter/AppListAdapter$ViewHolder;->icon:Landroid/widget/ImageView;

    .line 49
    invoke-virtual {p2, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 54
    :goto_2a
    iget-object v2, p0, Lcom/brixd/niceapp/community/adapter/AppListAdapter;->mInstalledApps:Ljava/util/List;

    invoke-interface {v2, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/brixd/niceapp/community/model/InstalledAppModel;

    .line 55
    .local v0, "app":Lcom/brixd/niceapp/community/model/InstalledAppModel;
    iget-object v2, v1, Lcom/brixd/niceapp/community/adapter/AppListAdapter$ViewHolder;->appName:Landroid/widget/TextView;

    invoke-virtual {v0}, Lcom/brixd/niceapp/community/model/InstalledAppModel;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 56
    iget-object v2, v1, Lcom/brixd/niceapp/community/adapter/AppListAdapter$ViewHolder;->icon:Landroid/widget/ImageView;

    invoke-virtual {v0}, Lcom/brixd/niceapp/community/model/InstalledAppModel;->getIcon()Landroid/graphics/drawable/Drawable;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 58
    return-object p2

    .line 51
    .end local v0    # "app":Lcom/brixd/niceapp/community/model/InstalledAppModel;
    .end local v1    # "holder":Lcom/brixd/niceapp/community/adapter/AppListAdapter$ViewHolder;
    :cond_45
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/brixd/niceapp/community/adapter/AppListAdapter$ViewHolder;

    .restart local v1    # "holder":Lcom/brixd/niceapp/community/adapter/AppListAdapter$ViewHolder;
    goto :goto_2a
.end method
